package com.crungoo.batis;

import org.apache.ibatis.annotations.Select;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author : fujc-dev@qq.com
 * @created : 2022/7/5 14:24
 */

public class LubanInvocationHandler implements InvocationHandler {
	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		// 这里的实现逻辑就是具体的查询逻辑
		System.out.println("connection mysql...");
		// method
		Select annotation = method.getAnnotation(Select.class);
		String sql = annotation.value()[0];
		System.out.println(sql);
		//Class<?> returnType = method.getReturnType();
		return null;
	}
}
